<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp"%>
<html>
<style type="text/css">
    *{margin:0;padding:0;font-size:100%;}
    a{text-decoration: none;color:#333;}
    /*css为clearfix，清除浮动*/
    .clearfix::before,
    .clearfix::after{content: "";height: 0;line-height: 0;display: block;visibility: hidden;clear: both;}
    .clearfix:after{clear:both;}
    .clearfix{*zoom:1;/*IE/7/6*/}
    .hcontent{padding:20px;}

    .hbox{width: 200px;height:100px;float: left;background:#fff;text-align: center;border-radius: 6px; border: 1px solid #d3d3d3;margin:10px;position: relative;overflow: hidden;}
    .hbox h3{color:#3d4d65;font-size: 14px;height: 65px;line-height: 65px;background: #fff;border-radius: 6px;}
    .hbox .hbtm{width: 100%;height: 38px;line-height: 38px;position: absolute;bottom: 0;background:#f4f4f4;}
    .hbtm a{ display: block;width: 49%;float: left;cursor: pointer;}
    .hbtm a:hover,.hbtm a:hover i{ color:#5f9ea0; }
    .hbtm a:first-child{border-right: 1px solid #e3e0e0;}
    .hbtm a:last-child{border-left: 1px solid #e3e0e0;}
    .hbtm a i{ margin-right: 5px; position: relative; top:2px; }
    .h_con_tit{font-size: 20px;line-height: 35px;position: relative;padding:20px;}
    .h_con_tit .sp2{color:#5f9ea0}
</style>
<body>

<div class="easyui-accordion" style=" margin:0px">
    <div title="Hello Word！Welcome to use Java EE Rapid Development Platform.author:Dadou" data-options="iconCls:'fi-widget icon-green',selected:true" style="overflow:auto;padding:20px;">
        <div class="h_con_tit"><span class="sp1">尊敬的：</span><span class="sp2"><shiro:principal></shiro:principal> </span>，下午好！<time class="h_time"></time>！</div>
        <h4 style="padding:0px 20px 20px">（注：使用平台过程中，如有疑问，请邮件：sc-rc@foxmail.com）</h4>
    </div>
    <div title="Tool－POI" data-options="iconCls:'fi-widget icon-blue'" style="overflow:auto;padding:20px;">
        <div class="hbox">
            <h3>February 2015</h3>
            <div class="hbtm">
                <a href="javascript:;" title=""><i class="fi-download icon-gray"></i>下载模版</a>
                <a href="javascript:;" title=""><i class="fi-upload icon-gray"></i>导入数据</a>
            </div>
        </div>
        <div class="hbox">
            <h3>February 2015</h3>
            <div class="hbtm">
                <a href="javascript:;" title=""><i class="fi-download icon-gray"></i>下载模版</a>
                <a href="javascript:;" title=""><i class="fi-upload icon-gray"></i>导入数据</a>
            </div>
        </div>
        <div class="hbox">
            <h3>February 2015</h3>
            <div class="hbtm">
                <a href="javascript:;" title=""><i class="fi-download icon-gray"></i>下载模版</a>
                <a href="javascript:;" title=""><i class="fi-upload icon-gray"></i>导入数据</a>
            </div>
        </div>
        <div class="hbox">
            <h3>February 2015</h3>
            <div class="hbtm">
                <a href="javascript:;" title=""><i class="fi-download icon-gray"></i>下载模版</a>
                <a href="javascript:;" title=""><i class="fi-upload icon-gray"></i>导入数据</a>
            </div>
        </div>
    </div>
    <div title="Tool－Upload2ALiYunOss" data-options="iconCls:'fi-widget icon-blue'" style="overflow:auto;padding:20px;">
        <form id="toolUploadForm" method="post" enctype="multipart/form-data" >
            <input name="uploadFile" type="file" id='uploadFile' style="display:none">
        </form>
        <div style="margin-bottom: 10px">
            <input type="text" id='uploadUrl' class="easyui-textbox" data-options="prompt:'选择文件',width:500,height:30"/>
            <a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'fi-upload',height:30" onclick="toolUpload()">点击上传</a>
        </div>
        <div>
            <input id="uploadUrlEnd" type="text" class="easyui-textbox" data-options="prompt:'上传成功后再此回显文件地址',width:500,height:30" />
            <a id="toolUploadOpenUrl" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'fi-eye',height:30" target="_blank" >打开链接</a>
        </div>
    </div>
    <div title="Tool－weChatAsseccToken" data-options="iconCls:'fi-widget icon-blue'" style="overflow:auto;padding:20px;">
        <div style="margin-bottom: 10px">
            <a href="javascript:;" onclick="getToken('1')" class="easyui-linkbutton"data-options="iconCls:'fi-credit-card icon-yellow',height:30">获取Redis中的Token</a>
            <a href="javascript:;" onclick="getToken('2')" class="easyui-linkbutton"data-options="iconCls:'fi-burst-new icon-green',height:30">获取新的Token</a>
        </div>
        <div>
            <input id="wxToken" class="easyui-textbox" data-options="width:600,height:30,prompt:'WeChatAsseccToken'"/>
        </div>
    </div>
</div>

</body>
<script>
    $(function(){
        var myDate = new Date();
        var str="今天是："+myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+ myDate.getDate()+"日  星期"+toHZ(myDate.getDay());
        $('.h_time').html(str);
    })
    function toHZ(d) {
        switch(d)
        {
            case 1:
                return "一";
            case 2:
                return "二";
            case 3:
                return "三";
            case 4:
                return "四";
            case 5:
                return "五";
            case 6:
                return "六";
            case 7:
                return "日";
        }
    }

    $(function(){
        $('#uploadUrl').textbox('textbox').bind('click', function() {$("#uploadFile").click();});
        $('#uploadFile').change(function(){$('#uploadUrl').textbox('setValue',$("#uploadFile").val());})
    })
    function toolUpload(){
        var file=$("#uploadFile").val();
        if (file.length<=0){
            layer.msg("请选择文件",{icon:2})
            return false;
        }
        progressLoad();
        var options={
            url:"${path}/admin/fast/upload",
            dataType:"json",
            success:function(msg){
                progressClose();
                layer.msg("上传成功!",{icon:1})
                $('#uploadUrlEnd').textbox('setValue',msg.obj.url);
                $("#toolUploadOpenUrl").attr("href",msg.obj.url);
            }
        };
        $("#toolUploadForm").ajaxSubmit(options);
    }
    function getToken(type){
        progressLoad();
        $.post("${path}/admin/fast/getToken",{"type":type},function(msg){
            progressClose();
            if (msg.code==200){
                $("#wxToken").textbox('setValue',msg.obj);
            }else{
                layer.msg("获取失败",{icon:2});
            }
        },"json");
    }

</script>
</html>
